package com.biz.hunter.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.biz.hunter.dao.OrderDAO;
import com.biz.hunter.dao.OrderDescDAO;
import com.biz.hunter.dao.OrderInterviewDAO;
import com.biz.hunter.dao.OrderLeaveDAO;
import com.biz.hunter.dao.OrderPlanDAO;
import com.biz.hunter.dao.OrderResumeDAO;
import com.biz.hunter.dao.OrderSalaryDAO;
import com.biz.hunter.db.entity.Order;
import com.biz.hunter.db.entity.OrderDesc;
import com.biz.hunter.db.entity.OrderInterview;
import com.biz.hunter.db.entity.OrderLeave;
import com.biz.hunter.db.entity.OrderPlan;
import com.biz.hunter.db.entity.OrderResume;
import com.biz.hunter.db.entity.OrderSalary;
import com.biz.hunter.service.IOrderService;
@Service
public class OrderService implements IOrderService
{
	@Autowired
	private OrderDAO orderDAO;
	@Autowired
	private OrderDescDAO orderDescDAO;
	@Autowired
	private OrderResumeDAO orderResumeDAO;
	@Autowired
	private OrderSalaryDAO orderSalaryDAO;
	@Autowired
	private OrderInterviewDAO orderInterviewDAO;
	@Autowired
	private OrderPlanDAO orderPlanDAO;
	@Autowired
	private OrderLeaveDAO orderLeaveDAO;
	
	public Order getById(int Id){
		return orderDAO.getById(Id);
	}

	/** 原来是updDiffPrice 没有找到此方法 */
	public int updDiffPrice(Integer priceDiffTime,Integer priceDiffMoney,Integer orderId){
		return orderDAO.updPriceDiff(priceDiffTime,priceDiffMoney,orderId);
	}
	
	public OrderDesc getOrderDescById(long Id){
		return orderDescDAO.getById(Id);
	}
	
	public OrderResume getResumeById(long id){
		return orderResumeDAO.getById(id);
	}
	public long saveOrderResume(OrderResume resume){
		return orderResumeDAO.saveOrderResume(resume);
	}
	
	public long updOrderResume(String fileupd,String time,long id){
		return orderResumeDAO.updOrderResume(fileupd,time,id);
	}
	
	public OrderResume getByOrderId(long orderId){
		return orderResumeDAO.getByOrderId(orderId);
	}
	public long saveOrderSalary(OrderSalary salary){
		return orderSalaryDAO.saveOrderSalary(salary);
	}
	
	public OrderSalary getSalaryByOrderId(long orderId){
		return orderSalaryDAO.getByOrderId(orderId);
	}
	
	public OrderSalary getSalaryById(long Id){
		return orderSalaryDAO.getById(Id);
	}
	
	public OrderInterview getInterviewById(long Id){
		return orderInterviewDAO.getInterviewById(Id);
	}
	
	/**
	 * get order interview id
	 * @param orderId
	 * @return
	 */
	public OrderInterview getInterviewByOrderId(long orderId){
		return orderInterviewDAO.getInterviewByOrderId(orderId);
	}
	
	/**
	 * save interview
	 * @param interview
	 * @return
	 */
	public long saveOrderInterview(OrderInterview interview){
		return orderInterviewDAO.saveOrderInterview(interview);
	}
	
	/**
	 * get plan id
	 * @param Id
	 * @return
	 */
	public OrderPlan getPlanById(long Id){
		return orderPlanDAO.getPlanById(Id);
	}
	
	public OrderPlan getPlanByOrderId(long orderId){
		return orderPlanDAO.getPlanByOrderId(orderId);
	}
	
	public long saveOrderPlan(OrderPlan plan){
		return orderPlanDAO.saveOrderPlan(plan);
	}
	
	/**
	 * get leave id
	 * @param Id
	 * @return
	 */
	public OrderLeave getLeaveById(long Id){
		return orderLeaveDAO.getLeaveById(Id);
	}
	
	public OrderLeave getLeaveByOrderId(long orderId){
		return orderLeaveDAO.getLeaveByOrderId(orderId);
	}
	
	public long saveOrderLeave(OrderLeave leave){
		return orderLeaveDAO.saveOrderLeave(leave);
	}
}
